package heima_design.model09;

import java.io.Serializable;

/**
 * @ClassName: Singleton
 * @Description: 序列化反序列化破坏单例模式
 * @Version: v1.0.0
 * @Author: tamir
 * @Date: 2022/06/02
 * Modification History:
 * Date             Author      Version     Description
 * -------------------------------------------------------------
 * 2022/06/02      tamir        v1.0.0      创建
 */
public class Singleton implements Serializable {
    
    //私有构造方法
    private Singleton() {
    }
    
    private static class SingletonHolder {
        private static final Singleton INSTANCE = new Singleton();
    }
    
    //对外提供静态方法获取该对象
    public static Singleton getInstance() {
        return SingletonHolder.INSTANCE;
    }
}